package net.tv90.bfmccore.game.impl;

import net.tv90.bfmccore.game.GameBase;
import net.tv90.bfmccore.game.GameManager;
import net.tv90.bfmccore.game.commander.TDMCommanderSystem;
import net.tv90.bfmccore.slot.*;
import net.tv90.bfmccore.util.HUD.ImageShow;
import net.tv90.bfmccore.util.HUD.TextShow;
import net.tv90.bfmccore.util.vector.Vector2i;
import org.bukkit.entity.Player;

import java.security.SecureRandom;
import java.util.*;

import static net.tv90.bfmccore.BFMCCore.plugin;
import static net.tv90.bfmccore.helper.FactionHelper.getCountry2;
import static net.tv90.bfmccore.slot.SlotHelper.giveSlot;
import static net.tv90.bfmccore.util.TimeUtil.secondsToDate;

public class GunMasterGame extends TDMGame {

    public static Map<Player, Integer> playerSlotProgress = new HashMap<>();
    public static List<Slot> currentSlotList;
    static List<List<Slot>> slotList = new ArrayList<>();

    static {
        HashMap<String, HashMap<Integer, Integer>> gadgets = new HashMap<>();
        HashMap<Integer, Integer> bandage = new HashMap<>();
        bandage.put(1, 7);
        HashMap<Integer, Integer> food = new HashMap<>();
        food.put(5, 8);
        gadgets.put("FLANSMOD_MEDKIT", bandage);
        gadgets.put("FLANSMOD_SMALLFOODCAN", food);

        Slot slot0 = new Slot(new MainWeapon("FLANSMOD_M60ULT", "FLANSMOD_762X51100RDEXBOX", 2, null),
                new SideArms(), "FLANSMOD_RIOTSHIELD", null, new Grenade("FLANSMOD_RGO", 3), gadgets);
        Slot slot1 = new Slot(new MainWeapon("FLANSMOD_STARMISSILE", "FLANSMOD_STARAMMO", 6, null),
                new SideArms(), "FLANSMOD_RIOTSHIELD", null, new Grenade("FLANSMOD_RGO", 3), gadgets);
        Slot slot2 = new Slot(new MainWeapon("FLANSMOD_M136CS", "FLANSMOD_M136AMMO", 6, null),
                new SideArms(), "FLANSMOD_RIOTSHIELD", null, new Grenade("FLANSMOD_RGO", 3), gadgets);
        Slot slot3 = new Slot(new MainWeapon("FLANSMOD_RPG7V2", "FLANSMOD_RPGAMMO", 6, null),
                new SideArms(), "FLANSMOD_RIOTSHIELD", null, new Grenade("FLANSMOD_RGO", 3), gadgets);
        Slot slot4 = new Slot(new MainWeapon("FLANSMOD_MK153", "FLANSMOD_MK153AMMO", 6, null),
                new SideArms(), "FLANSMOD_RIOTSHIELD", null, new Grenade("FLANSMOD_RGO", 3), gadgets);
        Slot slot5 = new Slot(new MainWeapon("FLANSMOD_PF89", "FLANSMOD_PF89ROCKET", 6, null),
                new SideArms(), "FLANSMOD_RIOTSHIELD", null, new Grenade("FLANSMOD_RGO", 3), gadgets);
        Slot slot6 = new Slot(new MainWeapon("FLANSMOD_MBTLAW", "FLANSMOD_MBTLAWAMMO", 6, null),
                new SideArms(), "FLANSMOD_RIOTSHIELD", null, new Grenade("FLANSMOD_RGO", 3), gadgets);
        Slot slot7 = new Slot(new MainWeapon("FLANSMOD_RPG16", "FLANSMOD_RPG16AMMO", 6, null),
                new SideArms(), "FLANSMOD_RIOTSHIELD", null, new Grenade("FLANSMOD_RGO", 3), gadgets);
        Slot slot8 = new Slot(new MainWeapon("FLANSMOD_M4CG", "FLANSMOD_84MMMPAT", 6, null),
                new SideArms(), "FLANSMOD_RIOTSHIELD", null, new Grenade("FLANSMOD_RGO", 3), gadgets);
        Slot slot9 = new Slot(new MainWeapon("FLANSMOD_SA14", "FLANSMOD_SA14AMMO", 6, null),
                new SideArms(), "FLANSMOD_RIOTSHIELD", null, new Grenade("FLANSMOD_RGO", 3), gadgets);
        Slot slot10 = new Slot(new MainWeapon("FLANSMOD_M202", "FLANSMOD_M202AMMO", 4, null),
                new SideArms(), "FLANSMOD_RIOTSHIELD", null, new Grenade("FLANSMOD_RGO", 3), gadgets);
        Slot slot11 = new Slot(new MainWeapon("FLANSMOD_ERYX", "FLANSMOD_ERYXAMMO", 6, null),
                new SideArms(), "FLANSMOD_RIOTSHIELD", null, new Grenade("FLANSMOD_RGO", 3), gadgets);
        Slot slot12 = new Slot(new MainWeapon("FLANSMOD_ARUAVDEPLOYER", "FLANSMOD_ARUAV", 6, null),
                new SideArms(), "FLANSMOD_RIOTSHIELD", null, new Grenade("FLANSMOD_RGO", 3), gadgets);
        Slot slot13 = new Slot(new MainWeapon("FLANSMOD_XM214", "FLANSMOD_XM214AMMO", 6, null),
                new SideArms(), "FLANSMOD_RIOTSHIELD", null, new Grenade("FLANSMOD_RGO", 3), gadgets);
        Slot slot14 = new Slot(new MainWeapon("FLANSMOD_XM25", "FLANSMOD_25MMAIRBURST", 4, null),
                new SideArms(), "FLANSMOD_RIOTSHIELD", null, new Grenade("FLANSMOD_RGO", 3), gadgets);
        Slot slot15 = new Slot(new MainWeapon("FLANSMOD_MGL140", "FLANSMOD_40MMHE", 6, null),
                new SideArms(), "FLANSMOD_RIOTSHIELD", null, new Grenade("FLANSMOD_RGO", 3), gadgets);
        Slot slot16 = new Slot(new MainWeapon("FLANSMOD_AMR2CQB", "FLANSMOD_50CALEXPLOSIVE5RDMAG", 6, null),
                new SideArms(), "FLANSMOD_RIOTSHIELD", null, new Grenade("FLANSMOD_RGO", 3), gadgets);
        Slot slot17 = new Slot(new MainWeapon("FLANSMOD_AW50", "FLANSMOD_50CALEXPLOSIVE5RDMAG", 6, null),
                new SideArms(), "FLANSMOD_RIOTSHIELD", null, new Grenade("FLANSMOD_RGO", 3), gadgets);
        Slot slot18 = new Slot(new MainWeapon("FLANSMOD_CROSSBOW410", "FLANSMOD_EXPLOSIVEARROW", 30, null),
                new SideArms(), "FLANSMOD_RIOTSHIELD", null, new Grenade("FLANSMOD_RGO", 3), gadgets);
        Slot slot19 = new Slot(new MainWeapon(),
                new SideArms(), "FLANSMOD_RIOTSHIELD", null, new Grenade("FLANSMOD_EMPGRENADE", 3), gadgets);

        List<Slot> slotLine0 = new ArrayList<>();
        slotLine0.add(slot0);
        slotLine0.add(slot1);
        slotLine0.add(slot2);
        slotLine0.add(slot3);
        slotLine0.add(slot4);
        slotLine0.add(slot5);
        slotLine0.add(slot6);
        slotLine0.add(slot7);
        slotLine0.add(slot8);
        slotLine0.add(slot9);
        slotLine0.add(slot10);
        slotLine0.add(slot11);
        slotLine0.add(slot12);
        slotLine0.add(slot13);
        slotLine0.add(slot14);
        slotLine0.add(slot15);
        slotLine0.add(slot16);
        slotLine0.add(slot17);
        slotLine0.add(slot18);
        slotLine0.add(slot19);

        slotList.add(slotLine0);
    }

    static {
        HashMap<String, HashMap<Integer, Integer>> gadgets = new HashMap<>();
        HashMap<Integer, Integer> bandage = new HashMap<>();
        bandage.put(1, 7);
        HashMap<Integer, Integer> food = new HashMap<>();
        food.put(5, 8);
        gadgets.put("FLANSMOD_BANDAGE", bandage);
        gadgets.put("FLANSMOD_SMALLFOODCAN", food);

        Attachment attachment = new Attachment();
        attachment.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_ACOGTA31");

        Attachment attachment1 = new Attachment();
        attachment1.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_OKP7");

        Attachment attachment2 = new Attachment();
        attachment2.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_COYOTE");

        Attachment attachment3 = new Attachment();
        attachment3.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_8XSCOPE");

        Attachment attachment4 = new Attachment();
        attachment4.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_PRISMA");

        Attachment attachment5 = new Attachment();
        attachment5.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_M145");

        Attachment attachment6 = new Attachment();
        attachment6.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_CL6X");

        Slot slot0 = new Slot(new MainWeapon("FLANSMOD_TAPS79", "FLANSMOD_762X2520RDMAG", 8, attachment2.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot1 = new Slot(new MainWeapon("FLANSMOD_UMP45", "FLANSMOD_45ACP25RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot2 = new Slot(new MainWeapon("FLANSMOD_PPK20", "FLANSMOD_9X1930RDMAG", 8, attachment1.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot3 = new Slot(new MainWeapon("FLANSMOD_MP5A4", "FLANSMOD_9X1930RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot4 = new Slot(new MainWeapon("FLANSMOD_UMP9", "FLANSMOD_9X1930RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot5 = new Slot(new MainWeapon("FLANSMOD_CSLS06", "FLANSMOD_9X1950RDDRUM", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot6 = new Slot(new MainWeapon("FLANSMOD_ACE21", "FLANSMOD_556X4535RDMAG", 6, attachment2.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot7 = new Slot(new MainWeapon("FLANSMOD_SCARH", "FLANSMOD_762X5120RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot8 = new Slot(new MainWeapon("FLANSMOD_CZ805", "FLANSMOD_556X4530RDMAG", 6, attachment.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot9 = new Slot(new MainWeapon("FLANSMOD_ASVAL", "FLANSMOD_9X3920RDMAG", 6, attachment1.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot10 = new Slot(new MainWeapon("FLANSMOD_ACWR", "FLANSMOD_65X3930RDMAG", 6, attachment5.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot11 = new Slot(new MainWeapon("FLANSMOD_ACE53", "FLANSMOD_762X5125RDMAG", 6, attachment4.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot12 = new Slot(new MainWeapon("FLANSMOD_M39EMR", "FLANSMOD_762X5110RDMAG", 6, attachment3.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot13 = new Slot(new MainWeapon("FLANSMOD_JNG90", "FLANSMOD_762X515RDMAG", 6, attachment3.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot14 = new Slot(new MainWeapon("FLANSMOD_QBU10", "FLANSMOD_50CAL5RDMAG", 6, attachment6.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot15 = new Slot(new MainWeapon("FLANSMOD_M1014", "FLANSMOD_12GAUGEBIRDSHOT", 50, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot16 = new Slot(new MainWeapon("FLANSMOD_SPAS12", "FLANSMOD_12GAUGEBUCKSHOT", 50, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot17 = new Slot(new MainWeapon("FLANSMOD_M26MASS", "FLANSMOD_12GAUGE5RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot18 = new Slot(new MainWeapon("FLANSMOD_M500", "FLANSMOD_50MAGNUM", 30, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot19 = new Slot(new MainWeapon("FLANSMOD_DEFIBRILLATOR", "FLANSMOD_DEFIBRILLATORAMMO", 30, null),
                new SideArms(), null, null, new Grenade("FLANSMOD_COMBATAXE", 1), gadgets);

        List<Slot> slotLine0 = new ArrayList<>();
        slotLine0.add(slot0);
        slotLine0.add(slot1);
        slotLine0.add(slot2);
        slotLine0.add(slot3);
        slotLine0.add(slot4);
        slotLine0.add(slot5);
        slotLine0.add(slot6);
        slotLine0.add(slot7);
        slotLine0.add(slot8);
        slotLine0.add(slot9);
        slotLine0.add(slot10);
        slotLine0.add(slot11);
        slotLine0.add(slot12);
        slotLine0.add(slot13);
        slotLine0.add(slot14);
        slotLine0.add(slot15);
        slotLine0.add(slot16);
        slotLine0.add(slot17);
        slotLine0.add(slot18);
        slotLine0.add(slot19);

        slotList.add(slotLine0);
    }

    static {
        HashMap<String, HashMap<Integer, Integer>> gadgets = new HashMap<>();
        HashMap<Integer, Integer> bandage = new HashMap<>();
        bandage.put(1, 7);
        HashMap<Integer, Integer> food = new HashMap<>();
        food.put(5, 8);
        gadgets.put("FLANSMOD_BANDAGE", bandage);
        gadgets.put("FLANSMOD_SMALLFOODCAN", food);

        Attachment attachment = new Attachment();
        attachment.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_PKS07");

        Attachment attachment2 = new Attachment();
        attachment2.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_JGM4");

        Attachment attachment3 = new Attachment();
        attachment3.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_REFLEX");
        attachment3.addAttachment(Attachment.EnumAttachmentType.gadget, "FLANSMOD_1MWLASER");

        Attachment attachment4 = new Attachment();
        attachment4.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_OKP7");

        Attachment attachment5 = new Attachment();
        attachment5.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_ACOGTA31");

        Slot slot0 = new Slot(new MainWeapon("FLANSMOD_A91", "FLANSMOD_762X3930RDMAG", 6, attachment4.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot1 = new Slot(new MainWeapon("FLANSMOD_M16A4", "FLANSMOD_556X4530RDMAG", 6, attachment3.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot2 = new Slot(new MainWeapon("FLANSMOD_AN94", "FLANSMOD_545X3930RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot3 = new Slot(new MainWeapon("FLANSMOD_QBZ811", "FLANSMOD_762X3930RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot4 = new Slot(new MainWeapon("FLANSMOD_FAMAS", "FLANSMOD_556X4525RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot5 = new Slot(new MainWeapon("FLANSMOD_HAWK12G", "FLANSMOD_1845RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot6 = new Slot(new MainWeapon("FLANSMOD_870MCS", "FLANSMOD_12GAUGEBUCKSHOT", 30, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot7 = new Slot(new MainWeapon("FLANSMOD_MP7", "FLANSMOD_46X3040RDMAG", 6, attachment3.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot8 = new Slot(new MainWeapon("FLANSMOD_GROZA4", "FLANSMOD_9X3920RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot9 = new Slot(new MainWeapon("FLANSMOD_HCAR", "FLANSMOD_300620RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot10 = new Slot(new MainWeapon("FLANSMOD_PKP", "FLANSMOD_762X54100RDBOX", 6, attachment4.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot11 = new Slot(new MainWeapon("FLANSMOD_QBU88", "FLANSMOD_58X4210RDMAG", 6, attachment2.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot12 = new Slot(new MainWeapon("FLANSMOD_M82A3", "FLANSMOD_50CAL5RDMAG", 6, attachment5.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot13 = new Slot(new MainWeapon("FLANSMOD_JNG90", "FLANSMOD_762X545RDMAG", 6, attachment.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot14 = new Slot(new MainWeapon("FLANSMOD_TAURUS44", "FLANSMOD_44MAGNUM", 30, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot15 = new Slot(new MainWeapon("FLANSMOD_QSZ92", "FLANSMOD_9X1915RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot16 = new Slot(new MainWeapon("FLANSMOD_SAWEDOFF", "FLANSMOD_12GAUGEBUCKSHOT", 30, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot17 = new Slot(new MainWeapon("FLANSMOD_MBTLAW", "FLANSMOD_MBTLAWAMMO", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot18 = new Slot(new MainWeapon("FLANSMOD_M320", "FLANSMOD_40MMDART", 10, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot19 = new Slot(new MainWeapon(), new SideArms(), "FLANSMOD_ACB90", null, new Grenade("FLANSMOD_EPIPEN2", 1), gadgets);

        List<Slot> slotLine0 = new ArrayList<>();
        slotLine0.add(slot0);
        slotLine0.add(slot1);
        slotLine0.add(slot2);
        slotLine0.add(slot3);
        slotLine0.add(slot4);
        slotLine0.add(slot5);
        slotLine0.add(slot6);
        slotLine0.add(slot7);
        slotLine0.add(slot8);
        slotLine0.add(slot9);
        slotLine0.add(slot10);
        slotLine0.add(slot11);
        slotLine0.add(slot12);
        slotLine0.add(slot13);
        slotLine0.add(slot14);
        slotLine0.add(slot15);
        slotLine0.add(slot16);
        slotLine0.add(slot17);
        slotLine0.add(slot18);
        slotLine0.add(slot19);

        slotList.add(slotLine0);
    }

    static {
        HashMap<String, HashMap<Integer, Integer>> gadgets = new HashMap<>();
        HashMap<Integer, Integer> bandage = new HashMap<>();
        bandage.put(1, 7);
        HashMap<Integer, Integer> food = new HashMap<>();
        food.put(5, 8);
        gadgets.put("FLANSMOD_FIRSTAIDPACK", bandage);
        gadgets.put("FLANSMOD_SMALLFOODCAN", food);

        Attachment attachment = new Attachment();
        attachment.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_ACOGTA31");

        Attachment attachment1 = new Attachment();
        attachment1.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_PKA");

        Slot slot0 = new Slot(new MainWeapon("FLANSMOD_M110K5", "FLANSMOD_762X5125RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot1 = new Slot(new MainWeapon("FLANSMOD_M16A3", "FLANSMOD_556X4540RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot2 = new Slot(new MainWeapon("FLANSMOD_AEK971", "FLANSMOD_545X3930RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot3 = new Slot(new MainWeapon("FLANSMOD_FG42", "FLANSMOD_762X5120RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot4 = new Slot(new MainWeapon("FLANSMOD_FAMAS", "FLANSMOD_556X4525RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot5 = new Slot(new MainWeapon("FLANSMOD_SA58", "FLANSMOD_762X5130RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot6 = new Slot(new MainWeapon("FLANSMOD_G11", "FLANSMOD_47X3351RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot7 = new Slot(new MainWeapon("FLANSMOD_ACE23", "FLANSMOD_556X4535RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot8 = new Slot(new MainWeapon("FLANSMOD_M110A2", "FLANSMOD_762X5125RDMAG", 6, attachment.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot9 = new Slot(new MainWeapon("FLANSMOD_SR338", "FLANSMOD_338MAGNUM7RDMAG", 6, attachment.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot10 = new Slot(new MainWeapon("FLANSMOD_AUGA3", "FLANSMOD_556X4530RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot11 = new Slot(new MainWeapon("FLANSMOD_STG44", "FLANSMOD_762X3930RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot12 = new Slot(new MainWeapon("FLANSMOD_M2HANDHELD", "FLANSMOD_50CAL30RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot13 = new Slot(new MainWeapon("FLANSMOD_BEOWULF", "FLANSMOD_127X4210RDMAG", 6, attachment.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot14 = new Slot(new MainWeapon("FLANSMOD_PTRD", "FLANSMOD_ATBULLET", 20, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot15 = new Slot(new MainWeapon("FLANSMOD_XM240", "FLANSMOD_XM240AMMO", 2, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot16 = new Slot(new MainWeapon("FLANSMOD_VSS", "FLANSMOD_9X3930RDMAG", 6, attachment1.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot17 = new Slot(new MainWeapon("FLANSMOD_NTW20", "FLANSMOD_20X823RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot18 = new Slot(new MainWeapon("FLANSMOD_RORSCHMK1", "FLANSMOD_ELECTROMAGNETICBULLET", 20, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot19 = new Slot(new MainWeapon(), new SideArms(), "FLANSMOD_ACB90", null, new Grenade("FLANSMOD_IED", 1), gadgets);

        List<Slot> slotLine0 = new ArrayList<>();
        slotLine0.add(slot0);
        slotLine0.add(slot1);
        slotLine0.add(slot2);
        slotLine0.add(slot3);
        slotLine0.add(slot4);
        slotLine0.add(slot5);
        slotLine0.add(slot6);
        slotLine0.add(slot7);
        slotLine0.add(slot8);
        slotLine0.add(slot9);
        slotLine0.add(slot10);
        slotLine0.add(slot11);
        slotLine0.add(slot12);
        slotLine0.add(slot13);
        slotLine0.add(slot14);
        slotLine0.add(slot15);
        slotLine0.add(slot16);
        slotLine0.add(slot17);
        slotLine0.add(slot18);
        slotLine0.add(slot19);

        slotList.add(slotLine0);
    }

    static {
        HashMap<String, HashMap<Integer, Integer>> gadgets = new HashMap<>();
        HashMap<Integer, Integer> bandage = new HashMap<>();
        bandage.put(1, 7);
        HashMap<Integer, Integer> food = new HashMap<>();
        food.put(5, 8);
        gadgets.put("FLANSMOD_BANDAGE", bandage);
        gadgets.put("FLANSMOD_SMALLFOODCAN", food);

        Attachment attachment = new Attachment();
        attachment.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_ACOGTA31");

        Attachment attachment1 = new Attachment();
        attachment1.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_PKA");

        Attachment attachment2 = new Attachment();
        attachment2.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_REFLEX");

        Attachment attachment3 = new Attachment();
        attachment3.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_CL6X");

        Slot slot0 = new Slot(new MainWeapon("FLANSMOD_MP9", "FLANSMOD_9X1930RDMAG", 8, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot1 = new Slot(new MainWeapon("FLANSMOD_CBJMS", "FLANSMOD_65X2530RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot2 = new Slot(new MainWeapon("FLANSMOD_APC9K", "FLANSMOD_9X1925RDMAG", 8, attachment2.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot3 = new Slot(new MainWeapon("FLANSMOD_MP5SD", "FLANSMOD_9X1930RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot4 = new Slot(new MainWeapon("FLANSMOD_MX4", "FLANSMOD_9X1930RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot5 = new Slot(new MainWeapon("FLANSMOD_P90", "FLANSMOD_57X2850RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot6 = new Slot(new MainWeapon("FLANSMOD_MCX", "FLANSMOD_68X5130RDMAG", 6, attachment2.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot7 = new Slot(new MainWeapon("FLANSMOD_ACE52", "FLANSMOD_762X5125RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot8 = new Slot(new MainWeapon("FLANSMOD_MSBS", "FLANSMOD_556X4530RDMAG", 6, attachment.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot9 = new Slot(new MainWeapon("FLANSMOD_AR160", "FLANSMOD_556X4530RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot10 = new Slot(new MainWeapon("FLANSMOD_CSLR14", "FLANSMOD_762X5120RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot11 = new Slot(new MainWeapon("FLANSMOD_MK20SSR", "FLANSMOD_762X5120RDMAG", 6, attachment.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot12 = new Slot(new MainWeapon("FLANSMOD_NSG85", "FLANSMOD_762X5410RDMAG", 6, attachment3.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot13 = new Slot(new MainWeapon("FLANSMOD_T5000", "FLANSMOD_762X515RDMAG", 6, attachment1.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot14 = new Slot(new MainWeapon("FLANSMOD_DSR", "FLANSMOD_762X515RDMAG", 6, attachment.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot15 = new Slot(new MainWeapon("FLANSMOD_QBS09", "FLANSMOD_12GAUGEBUCKSHOT", 30, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot16 = new Slot(new MainWeapon("FLANSMOD_STRIKER", "FLANSMOD_12GAUGEBIRDSHOT", 50, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot17 = new Slot(new MainWeapon("FLANSMOD_NP7", "FLANSMOD_9X1915RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot18 = new Slot(new MainWeapon("FLANSMOD_RSH12", "FLANSMOD_50MAGNUM", 30, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot19 = new Slot(new MainWeapon("FLANSMOD_DEFIBRILLATOR", "FLANSMOD_DEFIBRILLATORAMMO", 30, null),
                new SideArms(), "FLANSMOD_ACB90", null, new Grenade("FLANSMOD_M84", 1), gadgets);

        List<Slot> slotLine0 = new ArrayList<>();
        slotLine0.add(slot0);
        slotLine0.add(slot1);
        slotLine0.add(slot2);
        slotLine0.add(slot3);
        slotLine0.add(slot4);
        slotLine0.add(slot5);
        slotLine0.add(slot6);
        slotLine0.add(slot7);
        slotLine0.add(slot8);
        slotLine0.add(slot9);
        slotLine0.add(slot10);
        slotLine0.add(slot11);
        slotLine0.add(slot12);
        slotLine0.add(slot13);
        slotLine0.add(slot14);
        slotLine0.add(slot15);
        slotLine0.add(slot16);
        slotLine0.add(slot17);
        slotLine0.add(slot18);
        slotLine0.add(slot19);

        slotList.add(slotLine0);
    }

    static {
        HashMap<String, HashMap<Integer, Integer>> gadgets = new HashMap<>();
        HashMap<Integer, Integer> bandage = new HashMap<>();
        bandage.put(1, 7);
        HashMap<Integer, Integer> food = new HashMap<>();
        food.put(5, 8);
        gadgets.put("FLANSMOD_BANDAGE", bandage);
        gadgets.put("FLANSMOD_SMALLFOODCAN", food);

        Attachment attachment = new Attachment();
        attachment.addAttachment(Attachment.EnumAttachmentType.barrel, "FLANSMOD_QSW06");

        Attachment attachment2 = new Attachment();
        attachment2.addAttachment(Attachment.EnumAttachmentType.grip, "FLANSMOD_LASER");

        Attachment attachment3 = new Attachment();
        attachment3.addAttachment(Attachment.EnumAttachmentType.barrel, "FLANSMOD_R2");

        Slot slot0 = new Slot(new MainWeapon("FLANSMOD_MP443", "FLANSMOD_9X1915RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade("FLANSMOD_V40", 3), gadgets);
        Slot slot1 = new Slot(new MainWeapon("FLANSMOD_QSZ92", "FLANSMOD_9X1915RDMAG", 6, attachment.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade("FLANSMOD_V40", 3), gadgets);
        Slot slot2 = new Slot(new MainWeapon("FLANSMOD_TAURUS44", "FLANSMOD_44MAGNUM", 30, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade("FLANSMOD_V40", 3), gadgets);
        Slot slot3 = new Slot(new MainWeapon("FLANSMOD_COMPACT45", "FLANSMOD_45ACP8RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade("FLANSMOD_V40", 3), gadgets);
        Slot slot4 = new Slot(new MainWeapon("FLANSMOD_DEAGLE44", "FLANSMOD_44MAGNUM7RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade("FLANSMOD_V40", 3), gadgets);
        Slot slot5 = new Slot(new MainWeapon("FLANSMOD_J941", "FLANSMOD_40SW10RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade("FLANSMOD_V40", 3), gadgets);
        Slot slot6 = new Slot(new MainWeapon("FLANSMOD_G18", "FLANSMOD_9X1915RDMAG", 6, attachment3.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade("FLANSMOD_V40", 3), gadgets);
        Slot slot7 = new Slot(new MainWeapon("FLANSMOD_NRP357", "FLANSMOD_357MAGNUM", 30, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade("FLANSMOD_V40", 3), gadgets);
        Slot slot8 = new Slot(new MainWeapon("FLANSMOD_NP22", "FLANSMOD_9X1915RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade("FLANSMOD_V40", 3), gadgets);
        Slot slot9 = new Slot(new MainWeapon("FLANSMOD_M45A1", "FLANSMOD_45ACP8RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade("FLANSMOD_V40", 3), gadgets);
        Slot slot10 = new Slot(new MainWeapon("FLANSMOD_MP412", "FLANSMOD_357MAGNUM", 30, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade("FLANSMOD_V40", 3), gadgets);
        Slot slot11 = new Slot(new MainWeapon("FLANSMOD_APS", "FLANSMOD_9X1915RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade("FLANSMOD_V40", 3), gadgets);
        Slot slot12 = new Slot(new MainWeapon("FLANSMOD_G17", "FLANSMOD_9X1915RDMAG", 6, attachment2.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade("FLANSMOD_V40", 3), gadgets);
        Slot slot13 = new Slot(new MainWeapon("FLANSMOD_M327", "FLANSMOD_357MAGNUM", 30, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade("FLANSMOD_V40", 3), gadgets);
        Slot slot14 = new Slot(new MainWeapon("FLANSMOD_M9", "FLANSMOD_9X1915RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade("FLANSMOD_V40", 3), gadgets);
        Slot slot15 = new Slot(new MainWeapon("FLANSMOD_NP7", "FLANSMOD_9X1915RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade("FLANSMOD_V40", 3), gadgets);
        Slot slot16 = new Slot(new MainWeapon("FLANSMOD_TYPE54", "FLANSMOD_762X258RDMAG", 30, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade("FLANSMOD_V40", 3), gadgets);
        Slot slot17 = new Slot(new MainWeapon("FLANSMOD_SHORTY12G", "FLANSMOD_12GAUGEBUCKSHOT", 30, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade("FLANSMOD_V40", 3), gadgets);
        Slot slot18 = new Slot(new MainWeapon("FLANSMOD_LAR44", "FLANSMOD_44MAGNUM", 30, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade("FLANSMOD_V40", 3), gadgets);
        Slot slot19 = new Slot(new MainWeapon("FLANSMOD_BLOWTORCH", "FLANSMOD_BLOWTORCHAMMO", 2, null),
                new SideArms(), "FLANSMOD_ACB90", null, new Grenade("FLANSMOD_COMBATAXE", 1), gadgets);

        List<Slot> slotLine0 = new ArrayList<>();
        slotLine0.add(slot0);
        slotLine0.add(slot1);
        slotLine0.add(slot2);
        slotLine0.add(slot3);
        slotLine0.add(slot4);
        slotLine0.add(slot5);
        slotLine0.add(slot6);
        slotLine0.add(slot7);
        slotLine0.add(slot8);
        slotLine0.add(slot9);
        slotLine0.add(slot10);
        slotLine0.add(slot11);
        slotLine0.add(slot12);
        slotLine0.add(slot13);
        slotLine0.add(slot14);
        slotLine0.add(slot15);
        slotLine0.add(slot16);
        slotLine0.add(slot17);
        slotLine0.add(slot18);
        slotLine0.add(slot19);

        slotList.add(slotLine0);
    }

    static {
        HashMap<String, HashMap<Integer, Integer>> gadgets = new HashMap<>();
        HashMap<Integer, Integer> bandage = new HashMap<>();
        bandage.put(1, 7);
        HashMap<Integer, Integer> food = new HashMap<>();
        food.put(5, 8);
        gadgets.put("FLANSMOD_BANDAGE", bandage);
        gadgets.put("FLANSMOD_SMALLFOODCAN", food);

        Attachment attachment = new Attachment();
        attachment.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_ACOGTA31");

        Attachment attachment2 = new Attachment();
        attachment2.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_KOBRA");

        Attachment attachment3 = new Attachment();
        attachment3.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_COYOTE");

        Attachment attachment4 = new Attachment();
        attachment4.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_PRISMA");

        Attachment attachment5 = new Attachment();
        attachment5.addAttachment(Attachment.EnumAttachmentType.barrel, "FLANSMOD_R2");

        Attachment attachment6 = new Attachment();
        attachment6.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_JGM4");

        Attachment attachment7 = new Attachment();
        attachment7.addAttachment(Attachment.EnumAttachmentType.scope, "FLANSMOD_PKS07");

        Slot slot0 = new Slot(new MainWeapon("FLANSMOD_CZ3A1", "FLANSMOD_9X1930RDMAG", 8, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot1 = new Slot(new MainWeapon("FLANSMOD_UZI", "FLANSMOD_9X1930RDMAG", 8, attachment5.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot2 = new Slot(new MainWeapon("FLANSMOD_PP19", "FLANSMOD_9X1950RDDRUM", 6, attachment2.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot3 = new Slot(new MainWeapon("FLANSMOD_TYPE82", "FLANSMOD_9X1840RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot4 = new Slot(new MainWeapon("FLANSMOD_QBZ95B", "FLANSMOD_58X4230RDMAG", 6, attachment3.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot5 = new Slot(new MainWeapon("FLANSMOD_AK74M", "FLANSMOD_545X3930RDMAG", 6, attachment2.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot6 = new Slot(new MainWeapon("FLANSMOD_HK416", "FLANSMOD_556X4530RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot7 = new Slot(new MainWeapon("FLANSMOD_AEK971", "FLANSMOD_545X3930RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot8 = new Slot(new MainWeapon("FLANSMOD_ASH12", "FLANSMOD_127X5520RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot9 = new Slot(new MainWeapon("FLANSMOD_M16LMG", "FLANSMOD_556X45100RDDRUM", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot10 = new Slot(new MainWeapon("FLANSMOD_U100MK5", "FLANSMOD_556X4530RDMAG", 6, attachment4.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot11 = new Slot(new MainWeapon("FLANSMOD_MK11MOD0", "FLANSMOD_762X5120RDMAG", 6, attachment.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot12 = new Slot(new MainWeapon("FLANSMOD_SVD12", "FLANSMOD_762X5410RDMAG", 6, attachment2.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot13 = new Slot(new MainWeapon("FLANSMOD_FYJS", "FLANSMOD_58X4210RDMAGFYJS", 6, attachment6.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot14 = new Slot(new MainWeapon("FLANSMOD_VKS", "FLANSMOD_50CAL5RDMAG", 6, attachment7.getStringMap()),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot15 = new Slot(new MainWeapon("FLANSMOD_M200", "FLANSMOD_408CHEYTAC5RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot16 = new Slot(new MainWeapon("FLANSMOD_LW2010", "FLANSMOD_12GAUGE8RDMAG", 6, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot17 = new Slot(new MainWeapon("FLANSMOD_KS12", "FLANSMOD_20GAUGEFC", 24, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot18 = new Slot(new MainWeapon("FLANSMOD_CROSSBOW410", "FLANSMOD_BULLETPOINTARROW", 30, null),
                new SideArms(), "FLANSMOD_M9BAYONET", null, new Grenade(), gadgets);
        Slot slot19 = new Slot(new MainWeapon(), new SideArms(), "FLANSMOD_ACB90", null, new Grenade("FLANSMOD_M116A1", 1), gadgets);

        List<Slot> slotLine = new ArrayList<>();
        slotLine.add(slot0);
        slotLine.add(slot1);
        slotLine.add(slot2);
        slotLine.add(slot3);
        slotLine.add(slot4);
        slotLine.add(slot5);
        slotLine.add(slot6);
        slotLine.add(slot7);
        slotLine.add(slot8);
        slotLine.add(slot9);
        slotLine.add(slot10);
        slotLine.add(slot11);
        slotLine.add(slot12);
        slotLine.add(slot13);
        slotLine.add(slot14);
        slotLine.add(slot15);
        slotLine.add(slot16);
        slotLine.add(slot17);
        slotLine.add(slot18);
        slotLine.add(slot19);

        slotList.add(slotLine);
    }

    static {
        currentSlotList = slotList.get(0);
    }

    public GunMasterGame() {
    }

    /**
     * 该局游戏启动
     *
     * @param game 游戏
     */
    @Override
    public void onStart(GameBase game) {
        currentSlotList = slotList.get(new SecureRandom().nextInt(slotList.size()));
        setTicket(game.maxTicket);
        setTime(game.maxTime);
        System.out.println("该局游戏启动");
        firstFactionList.clear();
        secondFactionList.clear();
        new GameThread().runTaskTimer(plugin, 20L, 20L);
        executeEnd = false;
        isEnd = false;
        updateSize();
    }

    @Override
    public void showGameInfo() {
        TextShow textShowTime = new TextShow(new Vector2i(-1, 10), secondsToDate(currentTime), 1.0D, "timeText", 1);
        TextShow textShowTicket = new TextShow(new Vector2i(-1, 20), firstFactionTicket + "-" + secondFactionTicket, 1.0D, "ticketText", 1);
        TextShow textShowStage = new TextShow(new Vector2i(-1, 30),
                "Stage: " + (getGunMasterMaxStageNum(getGunMasterMaxStage())) + "/" + currentSlotList.size(), 1.0D, "GunMasterStage", 1);
        TextShow textShowStage2 = new TextShow(new Vector2i(-1, 40), "Top Player: " + getGunMasterMaxStagePlayer(getGunMasterMaxStage()), 1.0D, "GunMasterStage2", 1);
        textShowTime.showToPlayers(firstFactionList);
        textShowTime.showToPlayers(secondFactionList);
        textShowTicket.showToPlayers(firstFactionList);
        textShowTicket.showToPlayers(secondFactionList);
        textShowStage.showToPlayers(firstFactionList);
        textShowStage.showToPlayers(secondFactionList);
        textShowStage2.showToPlayers(firstFactionList);
        textShowStage2.showToPlayers(secondFactionList);
        ImageShow image1 = new ImageShow(new Vector2i(390, 8), new Vector2i(15, 15), "[local]BattleField/" + firstFactionName + ".png", 1, "FAC1");
        ImageShow image2 = new ImageShow(new Vector2i(445, 8), new Vector2i(15, 15), "[local]BattleField/" + secondFactionName + ".png", 1, "FAC2");
        image1.showToPlayers(firstFactionList);
        image2.showToPlayers(firstFactionList);
        image1.showToPlayers(secondFactionList);
        image2.showToPlayers(secondFactionList);
    }

    public Map.Entry<Player, Integer> getGunMasterMaxStage() {
        if (playerSlotProgress != null && !playerSlotProgress.isEmpty()) {
            Optional<Map.Entry<Player, Integer>> optional = playerSlotProgress.entrySet()
                    .stream()
                    .max(Map.Entry.comparingByValue());
            return optional.orElse(null);
        }
        return null;
    }

    public String getGunMasterMaxStagePlayer(Map.Entry<Player, Integer> entry) {
        if (entry != null) {
            return entry.getKey().getName();
        }
        return "";
    }

    public int getGunMasterMaxStageNum(Map.Entry<Player, Integer> entry) {
        if (entry != null) {
            return entry.getValue() + 1;
        }
        return 1;
    }

    @Override
    public boolean isAboutToEnd() {
        return currentTime <= 60 || getGunMasterMaxStageNum(getGunMasterMaxStage()) >= currentSlotList.size() - 3;
    }

    @Override
    public String getGameInfo() {
        return "GUNMASTER " + mapName + " " + currentTime + " " + firstFactionName + ':' + firstFactionTicket + ' ' + secondFactionName + ':' + secondFactionTicket;
    }

    @Override
    public void deploy(Player p) {
        GameManager gm = GameManager.getInstance();
        gm.currentGame.teleportSinglePlayerToBattleField(p);
        GameManager.inBattleFieldPlayers.add(p);
        try {
            if (!p.isOp()) {
                try {
                    p.setOp(true);
                    p.performCommand("minecraft:clear");
                    p.performCommand("kit " + getCountry2(p) + "ASS");
                } finally {
                    p.setOp(false);
                }
            } else {
                p.performCommand("minecraft:clear");
                p.performCommand("kit " + getCountry2(p) + "ASS");
            }
            Slot slot = currentSlotList.get(playerSlotProgress.getOrDefault(p, 0));
            giveSlot(p, slot);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            p.closeInventory();
        }
    }

    @Override
    public void onCustomStart() {
        commanderSystem = new TDMCommanderSystem();
    }

    @Override
    public void onCustomEnd() {
        playerSlotProgress.clear();
    }
}
